import java.util.Arrays;

public class MyArray {
    public static void main(String[] args){
        MyArray test = new MyArray();
        test.array_1();
        test.array_2();
    }

    public void array_1(){
        int[] test1 = new int[] {1, 2, 3, 4};
        int[] test2 = test1;
        System.out.println(Arrays.toString(test1));
        System.out.println(Arrays.toString(test2));
        test1[0] = 124;
        System.out.println(Arrays.toString(test1));
        System.out.println(Arrays.toString(test2));
    }

    public void array_2(){
        Integer[] test1 = {1, 2, 3, 4};
        Integer[] test2 = test1;
        System.out.println(Arrays.toString(test1) + " | " +Arrays.toString(test2) );
        test1[0] = 123;
        System.out.println(Arrays.toString(test1) + " | " +Arrays.toString(test2) );
    }
}
